package com.sky.mapper;

import com.fasterxml.jackson.databind.introspect.Annotated;
import com.github.pagehelper.Page;
import com.sky.anno.Tablelnject;
import com.sky.dto.DishDTO;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishMapper {

    /**
     * 根据分类id查询菜品数量
     * @param categoryId
     * @return
     */
    Integer countByCategoryId(Long categoryId);

    @Tablelnject(OperationType.INSERT)
    void save(Dish dish);

    Page<Dish> page(DishPageQueryDTO pageQueryDTO);

    void delByIds(List<Long> ids);

    Long serviceByIds(Long id);
    @Tablelnject(OperationType.UPDATE)
    void upDate(Dish dish);

    Dish dishById(Long id);

    List<Dish> list(Long categoryId);

    Dish upById(Long dishId);

    Dish findById(Long dishId);

    List<Dish> findDishesByCid(DishDTO dishDTO);
}
